<template>
  <div class="header">
    <div class="header-buttton is-left" v-if="isLeft">
      <i class="fa fa-chevron-left" />
      <button @click="$emit('click')">返回</button>
    </div>
    <div class="header-title">{{ title }}</div>
  </div>
</template>

<script>
export default {
  name: "header",
  props: {
    title: String,
    isLeft: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style scoped>
.header {
  position: fixed;
  top: 0;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0 10px;
  width: 100%;
  height: 45px;
  line-height: 45px;
  background: #009eef;
  font-size: 16px;
  color: #fff;
  text-align: center;
}
.header .header-buttton {
  display: flex;
  align-items: center;
}
.header-buttton button {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}
.header-title {
  flex: 1;
}
.is-left {
  text-align: left;
}
</style>